package com.fyp.ptma.dao.service.iservice;

import java.util.List;

import javax.persistence.PersistenceException;

import org.hibernate.HibernateException;
import org.hibernate.exception.ConstraintViolationException;

import com.fyp.ptma.model.Application;
import com.fyp.ptma.model.Downloader;
import com.fyp.ptma.model.Group;
import com.fyp.ptma.model.User;

/**
 * 
 * @author YahyaArshad
 * 
 */
public interface IGroupService extends IService {

	/**
	 * 
	 * @param application
	 * @return
	 * @throws HibernateException
	 */
	public List<Group> getAllGroups(Application application)
			throws HibernateException;

	/**
	 * 
	 * @param group
	 * @return
	 * @throws HibernateException
	 */
	public List<Downloader> getAllDownloader(Group group)
			throws HibernateException;

	/**
	 * 
	 * @param downloader
	 * @return
	 * @throws ConstraintViolationException
	 * @throws PersistenceException
	 * @throws HibernateException
	 */
	public long addDownloaderInGroup(Downloader downloader)
			throws ConstraintViolationException, PersistenceException,
			HibernateException;

	/**
	 * 
	 * @param user
	 * @return
	 * @throws HibernateException
	 */
	public List<Group> getAllUserGroups(String email) throws HibernateException;

	/**
	 * 
	 * @param downloader
	 * @return
	 * @throws ConstraintViolationException
	 * @throws HibernateException
	 */
	public boolean deleteDownloaderFromGroup(Downloader downloader)
			throws ConstraintViolationException, HibernateException;

}
